Merge "mediawiki.action.edit.js: Remove WikiEditor iframe hack from 2010"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 6 Apr 2014 13:01:36 +0000 (13:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 6 Apr 2014 13:01:36 +0000 (13:01 +0000)
resources/mediawiki.action/mediawiki.action.edit.js

index 2bcc384..62f8e06 100644 (file)
        mw.toolbar = toolbar;
 
        $( function () {
-               var i, b, $iframe, editBox, scrollTop, $editForm;
+               var i, b, editBox, scrollTop, $editForm;
 
-               // currentFocus is used to determine where to insert tags
+               // Used to determine where to insert tags
                $currentFocused = $( '#wpTextbox1' );
 
                // Populate the selector cache for $toolbar
                $( document ).on( 'focus', 'textarea, input:text', function () {
                        $currentFocused = $( this );
                } );
-
-               // HACK: make $currentFocused work with the usability iframe
-               // With proper focus detection support (HTML 5!) this'll be much cleaner
-               // TODO: Get rid of this WikiEditor code from MediaWiki core!
-               $iframe = $( '.wikiEditor-ui-text iframe' );
-               if ( $iframe.length > 0 ) {
-                       $( $iframe.get( 0 ).contentWindow.document )
-                               // for IE
-                               .add( $iframe.get( 0 ).contentWindow.document.body )
-                               .focus( function () {
-                                       $currentFocused = $iframe;
-                               } );
-               }
        });
 
 }( mediaWiki, jQuery ) );